home *** CD-ROM | disk | FTP | other *** search
- /****i* SOURCE_FILE/INFO
- *
- * NAME
- * Page.js
- *
- * USAGE
- * Part of Netobjects JavaScript Library.
- *
- * COPYRIGHT
- * Copyright ⌐ 2000-2005 Website Pros, Inc.
- * All Rights Reserved.
- *
- * This is an unpublished work protected by Website Pros, Inc.
- * as a trade secret, and is not to be used or disclosed except as
- * expressly provided in a written license agreement executed by
- * you and Website Pros, Inc.
- *
- * <copyright@websitepros.com>
- *
- * NOTES
- * JavaScript code.
- *
- *****/
- if (!IS.isModuleInitialized("IS.NOF.Page"))
- {
- /****h* NOF_JavaScript_Library/NOF.Page
- *
- * NAME
- * NOF.Page
- *
- * DESCRIPTION
- *
- * External dependencies: none
- ****/
-
- /**
- * Constructor
- **/
- function NOF_Page( ) {
- this.__proto__ = NOF_Page.prototype;
-
- this.fsiNode = null; //FSINode instance
- }
-
- {
-
- // declaration member variables and constants
- var member = NOF_Page.prototype;
- member.CLASS_NAME = "NOF.Page";
-
- // declaration member methods
- var method = NOF_Page.prototype;
- /*
- NOF.Page(String name)
- NOF.Page (int uniqueId)
-
- create()
- string getName()
- setName (String newName)
- string getTitle()
- setTitle(String newTitle)
-
- getSite()
- int getIDNumber()
- boolean isStackedPage()
-
- NOF.Layout getLayout()
-
- ?? get/setBannerName(String name)
- ?? get/setButtonName(String name)
-
-
- NOF.Page getRootPage()
-
- NOF.Page getFirstChild()
- NOF. Page getParent()
- NOF.Page getNextSibling()
- NOF.Page getPreviousSibling()
-
- getAllComponents() //toate de pe pagina resp
- getCurrentComponent() //curent de pe pagina. numai daca pagina e selectata (egal cu getCurrentComponent din site)
-
- getAllElements // returns components and html objects and any other
- NOF.PageElement getDocumentElement - elementul root
-
- NOF.PageElement getElementById (id)
- NOF.PageElement getCurrentElement ()
-
- appendElement (NOF.PageElement)
- NOF.PageElement cloneElement ()
- removeElement
- hideElement / showElement ?
- getElementType : html object (text, image, form, etc) , component object, ???
- */
- /**
- * Get the name of this Page.
- *
- * @return Page's name
- **/
- method.getName = function () {
- var nName = this.fsiNode.Name;
- return nName;
- }
-
- /**
- * Sets the name of this Page.
- *
- * @param newName name of the page
- **/
- method.setName = function (/*String*/ newName) {
- this.fsiNode.Name = newName;
- }
-
- /**
- * Get the title of this Page.
- *
- * @return Page's title
- **/
- method.getTitle = function () {
- var tmp = this.fsiNode.Title;
- return tmp;
- }
-
- /**
- * Sets the title of this Page.
- *
- * @param nTitle title of the page
- **/
- method.setTitle = function (/*String*/ nTitle) {
- this.fsiNode.Title = nTitle;
- }
-
- /**
- * Get the ID number of this Page.
- *
- * @return Page's ID
- **/
- method.getIDNumber = function () {
- var tmp = this.fsiNode.Number;
- return tmp;
- }
-
- /**
- * Indicates whether the node is a stacked page.
- *
- * @return true if this Page is a stacked page.
- **/
- method.isStackedPage = function () {
- var tmp = this.fsiNode.StackedPage;
- return tmp;
- }
-
- /**
- * Get the name to be used in banners on the page.
- *
- * @return bannerName
- **/
- method.getBannerName = function () {
- var tmp = this.fsiNode.BannerName;
- return tmp;
- }
-
- /**
- * Specifies the default name to be used in banners on the page.
- *
- * @param bannerName
- **/
- method.setBannerName = function (/*String*/ bannerName) {
- this.fsiNode.BannerName = bannerName;
- }
-
- /**
- * Get the name to be used in navigation buttons on the page.
- *
- * @return buttonName
- **/
- method.getButtonName = function () {
- var tmp = this.fsiNode.ButtonName;
- return tmp;
- }
-
- /**
- * Specifies the default name to be used in navigation buttons on the page.
- *
- * @param buttonName
- **/
- method.setButtonName = function (/*String*/ buttonName) {
- this.fsiNode.ButtonName = buttonName;
- }
-
- /**
- * Get the layout associated to the page.
- *
- * @return a NOF.Layout object corresponding to this Page
- **/
- method.getLayout = function () {
- //TODO: implement NOF.Layout!
- var tmp = new NOF.Layout();
- tmp.fsiLayout = this.fsiNode.Layout;
- return tmp;
- }
-
- /**
- * Get root page (home page).
- *
- * @return root page (an instance of NOF.Page).
- **/
- method.getRootPage = function () {
- var tmp = new NOF.Page();
- tmp.fsiNode = this.fsiNode.RootNode;
- return tmp;
- }
-
- /**
- * Get first child page.
- *
- * @return first child page (an instance of NOF.Page) or null if there are no child pages.
- **/
- method.getFirstChild = function () {
- var tmp = new NOF.Page();
- tmp.fsiNode = this.fsiNode.FirstChild;
- if (tmp.fsiNode == null) {
- return null;
- }
- return tmp;
- }
-
- /**
- * Get the parent page.
- *
- * @return parent page (an instance of NOF.Page) or null if the calling page is the root page.
- **/
- method.getParent = function () {
- var tmp = new NOF.Page();
- tmp.fsiNode = this.fsiNode.Parent;
- if (tmp.fsiNode == null) {
- return null;
- }
- return tmp;
- }
-
- /**
- * Get the next sibling page.
- *
- * @return the next sibling page (an instance of NOF.Page) or null if there is no next sibling page.
- **/
- method.getNextSibling = function () {
- var tmp = new NOF.Page();
- tmp.fsiNode = this.fsiNode.NextSibling;
- if (tmp.fsiNode == null) {
- return null;
- }
- return tmp;
- }
-
- /**
- * Get the previous sibling page.
- *
- * @return the previous sibling page (an instance of NOF.Page) or null if there is no previous sibling page.
- **/
- method.getPreviousSibling = function () {
- var tmp = new NOF.Page();
- tmp.fsiNode = this.fsiNode.PreviousSibling;
- if (tmp.fsiNode == null) {
- return null;
- }
- return tmp;
- }
-
-
- /**
- * Creates a new node with the specified name in the current site,
- * as a child of the node object on which it is called.
- *
- * @param pName new Page's name
- * @return the new Page created (an instance of NOF.Page)
- **/
- method.createChildPage = function (/*String*/ pName) {
- if (this.fsiNode == null) {
- return null;
- }
- var tmp = new NOF.Page();
- tmp.fsiNode = this.fsiNode.CreateNode(pName);
- return tmp;
- }
-
-
- }
-
- NOF.__proto__.Page = NOF_Page;
- }